const STORAGE_KEY = "todos";
const STORAGE_KEY_FALSE = "todofalse";

export default {

	fetch(){
		let todoitems = JSON.parse( localStorage.getItem(STORAGE_KEY || '[]') );
		if( todoitems == null || todoitems == undefined ) todoitems= new Array();
		//alert(todoitems.length);
		return todoitems;
	},

	save(todoitems){
		localStorage.setItem(STORAGE_KEY, JSON.stringify(todoitems));
	},

	fetch_length(){
		let todofalse = localStorage.getItem(STORAGE_KEY_FALSE || 0 );
		return todofalse;
	},

	save_length(itemsfalse){
		localStorage.setItem(STORAGE_KEY_FALSE, itemsfalse);
	}

}
